class Solution {
public:
    vector<int> rowAndMaximumOnes(vector<vector<int>>& mat) {
        int m = mat.size(), n = mat[0].size();
        int ind = 0, ans = 0;
        for (int i = 0; i < m; i++) {
            int cnt = 0;
            for (int j = 0; j < n; j++) {
                cnt += (mat[i][j] == 1);
            }
            if (cnt > ans) {
                ans = cnt;
                ind = i;
            }
        }
        vector<int> res = {ind, ans};
        return res;
    }
};
